
#pragma once

#include <vector>
#include "pixelhistory.h"


enum SEACondition
{
	is,
	isnot,
	//issmallerthan,
	//isgraterthan,
	SEAConditionsNum,
};

/** 
 * To express the following condition, equivalent to an element of the IF part
 * IF the neighbor nBIndex in its history of historyStep has the SEACondition with nBValue
 * e.g. nbIndex = 1, historyStep = 2, condition = 0, nbValue = 1 reads:
 * IF neighbor 1 at the time 2 IS 1,
 */
class PartialSEACondition
{
private:
	int nBIndex;
	int historyStep;
	SEACondition condition;
	int nBValue;
	/*static*/ int nbRadius;
	/*static*/ int validHistorySteps;
public:
	PartialSEACondition(int nbRadius, int validHistorySteps);
	//PartialSEACondition(const PartialSEACondition& other);
	bool applies (const PixelHistory&  pixel) const;
	void mutateNBIndex (void);
	void mutatehistoryStep (void);
	void mutateCondition (void);
	void mutatenBValue (void);
	void randomize (void);
	friend ostream& operator<< (ostream& stream, const PartialSEACondition& searule);
};